package com.ssh.controller;

import com.common.repostitory.CommonRepository;
import com.ssh.service.TestService;
import com.ssh.entity.Consumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by zpen on 2018/2/23.
 */
@Controller("mainController")
@RequestMapping(value = "test")
public class MainController {

    @Autowired
    TestService testSeriver;

    @Qualifier("commonRepository")
    @Autowired
    CommonRepository consumerSerivce;


    @RequestMapping(value = "test")
    public String Test(){
        return "test";
    }


    @RequestMapping(value = "serivceTest")
    public String serivceTest(){
        Consumer consumer ;
       consumer = consumerSerivce.getEntity(Consumer.class,13L);
        consumer.setStatus("00");
        try {
            consumerSerivce.update(consumer);
        }catch (Exception e){
            e.printStackTrace();
        }
        return testSeriver.test();
    }
}
